package java_exceptions.what_is_exception;

public class JavaException5 {

	public static void main(String[] args) {
		try {
			divide(10,0);
		} catch (Exception ex) {
			System.out.println(ex.getMessage());
		}
	}

	static int divide(int x, int y) throws Exception{
		if (y == 0) {
			throw new Exception
					("denominator can not be 0");
		} else {
			return x / y;
		}
	}
}
